package com.yidu.boss.sys.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @author 
 */
public class Bond implements Serializable {
    private String bondid;

    private String bondno;

    private String bondname;

    private BigDecimal couponrate;

    @DateTimeFormat(pattern="yyyy-MM-dd")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    private Date bondstart;

    @DateTimeFormat(pattern="yyyy-MM-dd")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    private Date bondend;

    private String bondtype;

    private BigDecimal sum;

    private BigDecimal bondinterest;

    private Integer paynum;

    private static final long serialVersionUID = 1L;

    public String getBondid() {
        return bondid;
    }

    public void setBondid(String bondid) {
        this.bondid = bondid;
    }

    public String getBondno() {
        return bondno;
    }

    public void setBondno(String bondno) {
        this.bondno = bondno;
    }

    public String getBondname() {
        return bondname;
    }

    public void setBondname(String bondname) {
        this.bondname = bondname;
    }

    public BigDecimal getCouponrate() {
        return couponrate;
    }

    public void setCouponrate(BigDecimal couponrate) {
        this.couponrate = couponrate;
    }

    public Date getBondstart() {
        return bondstart;
    }

    public void setBondstart(Date bondstart) {
        this.bondstart = bondstart;
    }

    public Date getBondend() {
        return bondend;
    }

    public void setBondend(Date bondend) {
        this.bondend = bondend;
    }

    public String getBondtype() {
        return bondtype;
    }

    public void setBondtype(String bondtype) {
        this.bondtype = bondtype;
    }

    public BigDecimal getSum() {
        return sum;
    }

    public void setSum(BigDecimal sum) {
        this.sum = sum;
    }

    public BigDecimal getBondinterest() {
        return bondinterest;
    }

    public void setBondinterest(BigDecimal bondinterest) {
        this.bondinterest = bondinterest;
    }

    public Integer getPaynum() {
        return paynum;
    }

    public void setPaynum(Integer paynum) {
        this.paynum = paynum;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Bond other = (Bond) that;
        return (this.getBondid() == null ? other.getBondid() == null : this.getBondid().equals(other.getBondid()))
            && (this.getBondno() == null ? other.getBondno() == null : this.getBondno().equals(other.getBondno()))
            && (this.getBondname() == null ? other.getBondname() == null : this.getBondname().equals(other.getBondname()))
            && (this.getCouponrate() == null ? other.getCouponrate() == null : this.getCouponrate().equals(other.getCouponrate()))
            && (this.getBondstart() == null ? other.getBondstart() == null : this.getBondstart().equals(other.getBondstart()))
            && (this.getBondend() == null ? other.getBondend() == null : this.getBondend().equals(other.getBondend()))
            && (this.getBondtype() == null ? other.getBondtype() == null : this.getBondtype().equals(other.getBondtype()))
            && (this.getSum() == null ? other.getSum() == null : this.getSum().equals(other.getSum()))
            && (this.getBondinterest() == null ? other.getBondinterest() == null : this.getBondinterest().equals(other.getBondinterest()))
            && (this.getPaynum() == null ? other.getPaynum() == null : this.getPaynum().equals(other.getPaynum()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getBondid() == null) ? 0 : getBondid().hashCode());
        result = prime * result + ((getBondno() == null) ? 0 : getBondno().hashCode());
        result = prime * result + ((getBondname() == null) ? 0 : getBondname().hashCode());
        result = prime * result + ((getCouponrate() == null) ? 0 : getCouponrate().hashCode());
        result = prime * result + ((getBondstart() == null) ? 0 : getBondstart().hashCode());
        result = prime * result + ((getBondend() == null) ? 0 : getBondend().hashCode());
        result = prime * result + ((getBondtype() == null) ? 0 : getBondtype().hashCode());
        result = prime * result + ((getSum() == null) ? 0 : getSum().hashCode());
        result = prime * result + ((getBondinterest() == null) ? 0 : getBondinterest().hashCode());
        result = prime * result + ((getPaynum() == null) ? 0 : getPaynum().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", bondid=").append(bondid);
        sb.append(", bondno=").append(bondno);
        sb.append(", bondname=").append(bondname);
        sb.append(", couponrate=").append(couponrate);
        sb.append(", bondstart=").append(bondstart);
        sb.append(", bondend=").append(bondend);
        sb.append(", bondtype=").append(bondtype);
        sb.append(", sum=").append(sum);
        sb.append(", bondinterest=").append(bondinterest);
        sb.append(", paynum=").append(paynum);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}